package com.slz3.business.module.instantMessaging.insMessaging.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.instantMessaging.insMessaging.domain.InsMessaging;
import com.slz3.business.module.instantMessaging.insMessaging.domain.InsMessagingCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class InsMessagingResController extends InsMessagingResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, InsMessaging insMessaging) {
        if (InsMessagingResUnsafeValid.add(req, insMessaging)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$InsMessagingUpdateLock(req, insMessaging);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, InsMessagingCondition insMessagingCondition) {
        if (InsMessagingResUnsafeValid.delete(req, insMessagingCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$InsMessagingUpdateLock(req, insMessagingCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, InsMessaging insMessaging) {
        if (InsMessagingResUnsafeValid.modify(req, insMessaging)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$InsMessagingUpdateLock(req, insMessaging);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (InsMessagingResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return insMessagingResAtomic.info_$InsMessagingUpdateLock(req);
        if (InsMessagingResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$InsMessagingUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (InsMessagingResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, InsMessagingCondition insMessagingCondition) {
        //
        if (InsMessagingResUnsafeValid.auditSubmit(req, insMessagingCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$InsMessagingUpdateLock(req, insMessagingCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, InsMessagingCondition insMessagingCondition) {
        if (InsMessagingResUnsafeValid.audit(req, insMessagingCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$InsMessagingUpdateLock(req, insMessagingCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, InsMessagingCondition insMessagingCondition) {
        if (InsMessagingResUnsafeValid.auditReject(req, insMessagingCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$InsMessagingUpdateLock(req, insMessagingCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, InsMessagingCondition insMessagingCondition) {
        if (InsMessagingResUnsafeValid.usingEnable(req, insMessagingCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$InsMessagingUpdateLock(req, insMessagingCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, InsMessagingCondition insMessagingCondition) {
        if (InsMessagingResUnsafeValid.usingDisable(req, insMessagingCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$InsMessagingUpdateLock(req, insMessagingCondition);
        }
    }

}
